package com.qixin.web.config;

import com.qixin.web.interceptor.Sessioninterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by Zhang on 2018/8/26.
 *
 */
@Configuration
public class SessionConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //配置 不需要拦截的包和请求
   String[]excludePathPatterns=new String[]{
           "/login_redirect/**",
           "/checkWechat/check",
           "/weStationinfo/dateInsert",  //定时跑接口添加数据
           "/Yang/**",
           "/css/**",
           "/font/**",
           "/img/**",
           "/image/**",
           "/Hui-iconfont.1.0.8/**",
           "/weUser/login.html",
           "/weUser/main.html",   //个人中心
           "/weStationinfo/**",   //查桩搜索
		   "/WechatCar/index.html",
		   "/WechatCar/CarAdd.html",
		   "/chargeAdd/chargeAdd.html",
		   "/WechatCar/findCar",
		   "/WechatCar/info.html",
		   "/WechatCar/findCarByCarId",
		   "/WechatCar/findCarImagesByCarId",
		   "/WechatCar/insert",
		   "/WechatCar/upload",
		   "/chargeAdd/chargeAdd",
		   "/WechatCar/findCara",
		   "/scan/main.html",

          //  "/scan/**",   //扫一扫 需要拦截！！！
           "/weUser/regist.html",   //注册
           "/weUser/login.html",   //登陆
           "/weUser/**",
           "/js/**",
           //消息通知
           "/query_token",
           "/notification_stationStatus",
           "/notification_start_charge_result",
           "/notification_stop_charge_result",
           "/notification_charge_order_info",
           "/notification_equip_charge_status"

   };
        registry.addInterceptor(new Sessioninterceptor()).addPathPatterns("/**").excludePathPatterns(excludePathPatterns);
    }


}
